package com.oocl.customersystem.exception;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ExceptionManage {
    private Exception e ;
    private HttpServletRequest request;
    private HttpServletResponse response;
    
    
	public void handler() {
		if (e instanceof MyException) {

			try {
                request.setAttribute("excp", e);
				request.getRequestDispatcher("exception.jsp").forward(request,
						response);
			} catch (IOException e1) {
				e1.printStackTrace();
			} catch (ServletException e1) {
				e1.printStackTrace();
			}

		}

	}
    

	public ExceptionManage() {
		super();
	}

	public ExceptionManage(Exception e) {
		super();
		this.e = e;
	}

	public Exception getE() {
		return e;
	}

	public void setE(Exception e) {
		this.e = e;
	}

	public HttpServletRequest getRequest() {
		return request;
	}

	public void setRequest(HttpServletRequest request) {
		this.request = request;
	}

	public HttpServletResponse getResponse() {
		return response;
	}

	public void setResponse(HttpServletResponse response) {
		this.response = response;
	}
    
	
    
}
